-- Leviathan (c) v.v.balashoff
local Class = require('leviathan/Class')

local LayoutSystem = Class:derive('UILayoutSystem')

function LayoutSystem:new(domain)
    self.name = 'LayoutSystem'
    self.domain = domain
end

function LayoutSystem:update(dt)
    local ent = self.domain.entities
    for _, e in pairs(ent) do
        local x, y
        x, y = e:getWorldTransform()
        e.worldX = math.floor(x)
        e.worldY = math.floor(y)
    end
end

return LayoutSystem
